<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>05如何监听编辑器内容发生改变的事件</title>
		<!-- 添加kindeditor的引用 -->
		<script type="text/javascript" charset="utf-8" src="js/kindeditor/kindeditor.js"></script>
		<script type="text/javascript" charset="utf-8" src="js/kindeditor/lang/zh_CN.js"></script>
	</head>
	
	<script>
		var index = 1;
		var editor;
		KindEditor.ready(function(K){
			editor = K.create('textarea[id="content"]',{
				allowFileManager : true,
				afterChange : function(){
					document.getElementById("showKindeditor").innerHTML += "编辑器内容发生改变"+(index++) + "<br/>";
				}
			});
		});
	</script>
	
	<body>
		<!--overflow:auto;溢出时自动显示滚动条-->
		<div id="showKindeditor" style="overflow:auto;width:38%;height: 500px;border: 1px solid black;float: left;display: inline-block;">
			<h3>用于打印日志</h3>
		</div>
		<textarea id="content" style="width:60%;height: 500px;"></textarea>
	</body>
</html>
